package com.stud.system.factory;

import com.stud.common.exception.ServiceException;
import com.stud.common.utils.spring.SpringUtils;
import com.stud.system.properties.FileProperties;
import com.stud.system.service.FileEngine;
import com.stud.system.service.impl.LocalFileServiceImpl;

/**
 * @author Administrator
 * @date 2024-06-07 10:02:17
 * @description: TODO
 */
public class FileEngineBuilder {
    public static FileEngine build() {
        FileProperties fileProperties = SpringUtils.getBean(FileProperties.class);
        switch (fileProperties.getEngine()) {
            case "local":
                return SpringUtils.getBean(LocalFileServiceImpl.class);
//            case "minio":
//                return SpringUtils.getBean(MinioServiceImpl.class);
            default:
                throw new ServiceException("文件引擎配置错误");
        }
    }
}
